﻿<!DOCTYPE html>
<!--岗位安全职责考核管理编辑-->
<html>

<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <script src="/static/js/common.js"></script>
    <style>
        .cell {
            text-align: center;
        }
    </style>
</head>

<body>
    <div id="app" v-cloak class="popupW150">
        <el-form :model="Form" status-icon :rules="rules" ref="ruleForm" label-width="100px" size="mini"
                 label-position="right">
            <el-row>
                <el-col :span="24">
                    <p class="main-label">考核主题</p>
                    <p class="lh35">{{Form.theme}}</p>
                </el-col>


            </el-row>
            <el-row>
                <el-col :span="24">
                    <p class="main-label">考核年份</p>
                    <p class="lh35">{{Form.assessmentYear}}</p>
                </el-col>


            </el-row>
            <el-row>
                <el-col :span="11">
                    <p class="main-label">岗位名称</p>
                    <p class="lh35">{{Form.mark01}}</p>
                </el-col>
                <el-col :span="11" :offset="2">
                    <p class="main-label">部门</p>
                    <p class="lh35">{{Form.mark03}}</p>
                </el-col>

            </el-row>
            <el-row>
                <el-col :span="24">
                    <p class="main-label">岗位安全生产责任范围</p>
                    <p class="lh35">{{Form.postSafeProductionScope}}</p>
                </el-col>


            </el-row>

            <el-table ref="table" v-if="showTable" :data="tasks" :row-key="getRowKeys" border
                      @selection-change="handleSelectionChange" row-style="height:10px" style="width: 100%;">
                <el-table-column type="index" :label="PostSafeResponsibilityExamineManager.id" :index="indexMethod"
                                 width="60" show-overflow-tooltip="true"></el-table-column>
                <el-table-column prop="mark01" label="岗位人员" show-overflow-tooltip="true">
                </el-table-column>
                <el-table-column prop="mark04" label="考核得分" show-overflow-tooltip="true">
                </el-table-column>
                <el-table-column prop="mark02" label="上级领导" show-overflow-tooltip="true">
                </el-table-column>
                <el-table-column prop="approvalTime" label="审批时间" show-overflow-tooltip="true" :formatter="myformatDate">
                </el-table-column>
                <el-table-column prop="status" label="状态" show-overflow-tooltip="true">
                    <template slot-scope="scope">
                        <p v-if="scope.row.status=='0'">
                            未提交
                        </p>
                        <p v-if="scope.row.status=='1'">
                            提交
                        </p>
                        <p v-if="scope.row.status=='2'">
                            已审批
                        </p>

                    </template>
                </el-table-column>
                <el-table-column prop="update" label="详情" fixed="right">
                    <template slot-scope="scope">
                        <button type="button" class="elst-bt-xg" @click=UserInput2('xg',scope.row.id) style="text-align:center;">
                            详情
                        </button>
                    </template>
                </el-table-column>
            </el-table>



            <el-row type="flex" justify="end" style="margin-top:20px;">
                <el-form-item>

                    <el-button type="primary" @click="parent.ListItem.dialogVisible=false">{{col.btnBack}}</el-button>
                </el-form-item>
            </el-row>
        </el-form>
        <el-dialog title="岗位安全职责考核明细页" fullscreen="true" :visible.sync="ListItem1.dialogVisible" @close='closeDialog1' width="80%" height="80%"
                   top="10vh" modal-append-to-body="true">
            <iframe ref="iframe1" :src="ListItem1.InputUrl" style="height:95%;width:100%" frameborder="0"></iframe>
        </el-dialog>
    </div>
    <script type="text/javascript">
       
        app = new Vue({
            el: '#app',
            data: {
                //父业传参
                id: '',
                mydata: [],// UsersTree,
                ListItem1: {
                    //列表选择数组
                    tableMultipleSelection: [],
                    //分页
                    pagesizes: [5, 10, 40],
                    //分页控件显示内容
                    layout: '  prev, pager, next,sizes,total',
                    //一页数量
                    pagesize: 10,
                    //数据总量
                    total: 0,
                    //dialog src值
                    InputUrl: '',
                    //当前页码
                    currentPage: 1,
                    //dialog是否展示
                    dialogVisible: false,
                    //表格高度
                    tableHeight: 200,
                    //列表数据
                    tableData: [],
                    //数据源
                    dataSource: [],

                },
                //业务表单内容
                Form: {
                    id: guidEmpty,
                    //postPerson:'',
                    jobsAssessTask: '',
                    mark04: '',
                    mark01: '',
                    mark03: '',
                    postID:'',
                    postNameID: '',
                    theme:'',
                    //assessmentSubject:'',
                    assessmentYear: '',
                    postSafeProductionScope: '',
                    status:'0',
                    jG_JobsAssessDetail: [],
                    //tableData:[],
                },
                //任务集合
                tasks:[],
                //表格显示开关
                showTable: true,
                //表单验证
                rules: { }
            },
            methods: {
                //解決edge下select bug
                visibleChange: function (isVisible) {
                    visibleChange(isVisible)
                },
                //表格序号连续化
                indexMethod: function (index) { return index + 1; },
                closeDialog1: function () { var mythis = this; mythis.ListItem1.dialogVisible = false; },
                getData: function () {
                    var mythis = this;
                    if (mythis.id != null && mythis.id != '') {
                        myAjax("get", mythis, '/api/JG_JobsAssessTask/get?id=' + this.id, null, function (response) {
                            var ajaxModel = response.data;
                            //mythis.Form = ajaxModel;
                           
                            mythis.Form.assessmentYear = ajaxModel.assessmentYear.toString().substring(0, 4);
                            mythis.Form.theme = ajaxModel.theme;
                            mythis.Form.postSafeProductionScope = ajaxModel.postSafeProductionScope;
                            mythis.Form.mark01 = ajaxModel.sysDuty.name;//岗位
                            mythis.Form.mark03 = ajaxModel.sysDepartment.name;//部门
                        }, false);

                        myAjax("post", this, '/api/JG_JobsAssess/GetList', { model: { jobsAssessTask: mythis.id }, offset: 0, limit: 100 }, function (response) {

                            if (response.data == null || response.data.length == 0) {
                                mythis.tasks = []
                            } else {
                                mythis.tasks = response.data.pageData;
                            }
                        }, false);
                    }
                },
                UserInput2: function (val, id) {
                    
                    var mythis = this;
                    var url = "PostSafeResponsibilityExamineManagerInputMine2.html";
                    mythis.ListItem1.InputUrl = url + "?id=" + id + "&t=" + Date.parse(new Date()) ;
                   
                    mythis.ListItem1.dialogVisible = true;
                    //解决弹窗底下按钮显示不全
                    setTimeout(function () {
                        // alert($('.el-dialog__body').height())
                        var bodyH = $('.el-dialog__body').height()
                        $('.el-dialog__body').children('iframe').height(bodyH - 50)
                        // alert($('.el-dialog__body').children('iframe').height())
                    }, 100);
                },

               
            },
            mounted: function () {
                
                this.id = getUrlParam("id");
                this.getData();
                //if (this.Form.post) {
                //    this.showTable = true;
                //}
                console.log('this.Form', this.Form)
            }
        });
       
    </script>
</body>

</html>